import api from '@/libs/request'
import type { DoPostOrderStockUpQuery } from '@/apis/order/model'
export const doGetOrder = (params: any) => {
  return api.get('gruul-mall-order/order', params)
}
/**
 * 获取订单详情信息
 * @param {string} shopId 传该值已支付
 */
export const doGetOrderInfo = (orderNo: string, shopId?: string, packageId?: string, usePackage = true) => {
  const params: any = { shopId, usePackage }
  if (packageId) {
    params.packageId = packageId
  }
  return api.get(`gruul-mall-order/order/${orderNo}`, params)
}
/**
 * 门店订单进行备货完成操作
 */
export const doPostOrderStockUp = (data: DoPostOrderStockUpQuery) => {
  return api.post(`addon-shop-store/store/order/stock/up`, data)
}
/**
 * 门店订单核销
 */
export const doPutOrderVerification = (data: { storeId: string; code: string }) => {
  return api.put(`addon-shop-store/store/order/verification/${data.storeId}/${data.code} `)
}

/**
 * 根据模块类id获取配置信息
 */
export const queryConfigByModule = (params: string): Promise<any> => {
  return api.get(`gruul-mall-addon-platform/platform/config/query-config-by-module?modules=${params}`)
}

//获取教育基金订单详情
export const getEduDetail = (orderNo?: any) => {
  return api.get(`gruul-mall-order/order/edu/detail/${orderNo}`)
}